package pojo;

import java.math.BigDecimal;
import java.math.BigInteger;

public class playground {
    private Long playground_id;
    private  float price;
    private  String play_name;
    private  String playground_display;
    private  Long stadium_id;
    private  String sport_id;
    private  String bitmaps_today;
    private  String bitmaps_tomorrow;

    public playground() {
    }

    public playground(Long playground_id, float price, String play_name, String playground_display, Long stadium_id, String sport_id) {
        this.playground_id = playground_id;
        this.price = price;
        this.play_name = play_name;
        this.playground_display = playground_display;
        this.stadium_id = stadium_id;
        this.sport_id = sport_id;
        this.bitmaps_today="111111111111111111111111";
        this.bitmaps_tomorrow="111111111111111111111111";
    }

    public playground(Long playground_id, float price, String play_name, String playground_display, Long stadium_id, String sport_id, String bitmaps_today, String bitmaps_tomorrow) {
        this.playground_id = playground_id;
        this.price = price;
        this.play_name = play_name;
        this.playground_display = playground_display;
        this.stadium_id = stadium_id;
        this.sport_id = sport_id;
        this.bitmaps_today = bitmaps_today;
        this.bitmaps_tomorrow = bitmaps_tomorrow;
    }

    public Long getPlayground_id() {
        return playground_id;
    }

    public void setPlayground_id(Long playground_id) {
        this.playground_id = playground_id;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public String getPlay_name() {
        return play_name;
    }

    public void setPlay_name(String play_name) {
        this.play_name = play_name;
    }

    public String getPlayground_display() {
        return playground_display;
    }

    public void setPlayground_display(String playground_display) {
        this.playground_display = playground_display;
    }

    public Long getStadium_id() {
        return stadium_id;
    }

    public void setStadium_id(Long stadium_id) {
        this.stadium_id = stadium_id;
    }

    public String getSport_id() {
        return sport_id;
    }

    public void setSport_id(String sport_id) {
        this.sport_id = sport_id;
    }

    public String getBitmaps_today() {
        return bitmaps_today;
    }

    public void setBitmaps_today(String bitmaps_today) {
        this.bitmaps_today = bitmaps_today;
    }

    public String getBitmaps_tomorrow() {
        return bitmaps_tomorrow;
    }

    public void setBitmaps_tomorrow(String bitmaps_tomorrow) {
        this.bitmaps_tomorrow = bitmaps_tomorrow;
    }

    @Override
    public String toString() {
        return "playground{" +
                "playground_id=" + playground_id +
                ", price=" + price +
                ", play_name='" + play_name + '\'' +
                ", playground_display='" + playground_display + '\'' +
                ", stadium_id=" + stadium_id +
                ", sport_id='" + sport_id + '\'' +
                ", bitmaps_today='" + bitmaps_today + '\'' +
                ", bitmaps_tomorrow='" + bitmaps_tomorrow + '\'' +
                '}';
    }

    /*根据体育馆信息更场馆预约情况
            @param opentime 场馆开始时间
            @param closetime 场馆闭馆时间
            @return 无返回值
             */
    public void setRealTime(int opentime,int endtime,String choice){
        String real=new String();
        for(int i=0;i<24;i++){
            if(i>=opentime&& i<endtime){
                real+="1";
            }else{
                real+="0";
            }
        }
        if("today".equals(choice)){
            this.setBitmaps_today(real);
        }else{
            if("tomorrow".equals(choice)){
            this.setBitmaps_tomorrow(real);
            }else{
                System.out.println("无效的操作");
            }
        }


    }
}
